/*
 * Copyright (c) 2019.11，华乘电气科技有限公司
 * All rights reserved.
 *
 * 文件名称：spectrumdatafiledefine.h
 * 
 * 初始版本：1.0
 * 作者：洪澄
 * 创建日期：2019/11/08
 * 摘要：图谱数据文件定义
 * 当前版本：1.0
 */

#pragma once

#include <QString>

namespace DataSpecificationGW
{
    static constexpr const quint8 gs_ucUnrecordedByteValue = 0xff; // 未记录字节数据为0xff
    static constexpr const int gs_iFileHeadLength = 512; // 图谱文件头总长度
    static constexpr const int FILE_HEAD_RESERVE = 218;         // 图谱文件头预留长度（后段）
    static constexpr const int FILE_TAIL_LENTH = 36;         // 图谱文件尾总长度
    static constexpr const int FILE_TAIL_RESERVE = 34;         // 图谱文件尾预留长度（前段）
    static constexpr const int SPECTRUM_HEADER_LENGTH = 337;  // 图谱头信息长度（从图谱类型编码到存储数据类型）
    static constexpr const int BG_FILE_NAME_LENTH = 54;        //背景文件名称长度
    static constexpr const int SPECTRUM_BASE_LENGTH = 512;       // 图谱基础长度
    static constexpr const int MECH_COMMON_LENGTH = 363; //机械特性公共数据长度
    static constexpr const int AE_AMP_DATA_START_POS = 363;  // ae幅值数据开始的位置
    static constexpr const int TEV_AMP_DATA_START_POS = 346;  // tev幅值数据开始的位置
    static constexpr const int CURRENT_AMP_DATA_START_POS = 336;  // 电流幅值数据开始的位置
    static constexpr const int VERSON_STR_LENGTH = 4;    // 版本字符串长度
    static constexpr const int DATETIME_STR_LENGTH = 8;    // 时间字符串长度
    static constexpr const int UNICODE_STR_LENGTH = 128;    // Unicode字符串长度
    static constexpr const int ASCII_STR_LENGTH = 32;    // ASCII字符串长度
    static constexpr const int EQUIPMENT_NAME_LENGTH_OLD = 128; // 设备名称长度（旧版本定义）
    static constexpr const int EQUIPMENT_NAME_LENGTH = 118; // 设备名称长度
    static constexpr const int EQUIPMENT_CODE_LENGTH_OLD = 32; // 设备编码长度（旧版本定义）
    static constexpr const int EQUIPMENT_CODE_LENGTH = 42; // 设备编码长度

    // 字符串定义
    static constexpr const char* STR_FILE_ROOT_NODE_NAME = "mapDatas";
    static constexpr const char* STR_FILE_NODE_NAME_FILE_HEAD = "fileHead";
    static constexpr const char* STR_FILE_NODE_NAME_SPECTRUMS = "spectrums";
    static constexpr const char* STR_FILE_NODE_NAME_SPECTRUM = "spectrum";
    static constexpr const char* STR_FILE_NODE_NAME_CRC32 = "CRC32";
    static constexpr const char* STR_SPECTRUM_NODE_HEAD = "head";
    static constexpr const char* STR_SPECTRUM_NODE_EXTINFORMATION = "extInformation";
    static constexpr const char* STR_SPECTRUM_NODE_DATA = "data";
    static constexpr const char* STR_FILE_NODE_DATA_COLOR = "color";
    static constexpr const char* STR_FILE_NODE_DISCHARGE_COUNT = "dischargeCount";
    static constexpr const char* STR_FILE_NODE_COLOR_INDEX = "colorIndex";
    static constexpr const char* STR_FILE_NODE_DATAFILEPATH = "dataFilePath";

    static constexpr const char* STR_FILE_NODE_AE_PHASE = "AEPhase";
    static constexpr const char* STR_FILE_NODE_AE_PULSE = "AEPulse";
    static constexpr const char* STR_FILE_NODE_AE_AMP = "AEAmp";
    static constexpr const char* STR_FILE_NODE_AE_WAVE = "AEWave";
    static constexpr const char* STR_FILE_NODE_PRPS = "PRPS";
    static constexpr const char* STR_FILE_NODE_PRPD = "PRPD";
    static constexpr const char* STR_FILE_NODE_TEVPRPS = "TEVPRPS";
    static constexpr const char* STR_FILE_NODE_TEVPRPD = "TEVPRPD";
    static constexpr const char* STR_FILE_NODE_TEV_AMP = "TEVAmp";
    static constexpr const char* STR_FILE_NODE_PERD = "period";
    static constexpr const char* STR_FILE_NODE_WAVE = "wave";
    static constexpr const char* STR_FILE_NODE_CA_WAVE = "CAWave";
    static constexpr const char* STR_FILE_NODE_TIME_FREQ = "TF";
    static constexpr const char* STR_FILE_NODE_MECHANICAL = "mechanical";
    static constexpr const char* STR_FILE_NODE_MECHANICAL_COIL = "mechanicalCoilCurrent";
    static constexpr const char* STR_FILE_NODE_MECHANICAL_MOTOR = "mechanicalMotorCurrent";
    static constexpr const char* STR_FILE_NODE_MECHANICAL_SWITCH = "mechanicalSwitch";
    static constexpr const char* STR_FILE_NODE_INFRARED = "infrared";
    static constexpr const char* STR_FILE_NODE_CURRENT_AMP = "CurrentAmp";

    static constexpr const char* STR_VERSION = "version";     //版本号
    static constexpr const char* STR_GENERATION_TIME = "generationTime";      //生成文件的时间
    static constexpr const char* STR_SUBSTATION_NAME = "substationName";      //站点名称
    static constexpr const char* STR_COUNTRY_NAME = "country";      //国家名
    static constexpr const char* STR_PROVINCE_NAME = "province";      //省份名称
    static constexpr const char* STR_CITY_NAME = "city";      //城市名称
    static constexpr const char* STR_SUBSTATION_CODE = "substationCode";      // 站点编码
    static constexpr const char* STR_WEATHER = "weather";     //天气
    static constexpr const char* STR_TEMPERATURE = "temperature";     //环境温度
    static constexpr const char* STR_TEMPERATURE_UNIT = "temperatureUnit";     //环境温度的单位
    static constexpr const char* STR_HUMIDITY = "humidity";        //环境湿度
    static constexpr const char* STR_MANUFACTURER = "instrumentManufacturer";        //仪器厂家
    static constexpr const char* STR_INSTRUMENT_MODEL = "instrumentModel";     //仪器型号
    static constexpr const char* STR_INSTRUMENT_SN = "instrumentSN";        //仪器序列号
    static constexpr const char* STR_INSTRUMENT_VERSION = "instrumentVersion";       //仪器版本号
    static constexpr const char* STR_SYS_FREQUENCY = "sysFrequency";        //系统频率
    static constexpr const char* STR_SPECTRUM_COUNT = "spectrumCount";       //图谱数量
    static constexpr const char* STR_COMPANY_CODE = "companyCode";       //公司代码
    static constexpr const char* STR_DATA_FILE_VERSION = "dataFileVersion";       //内部数据规范版本号

    // 图谱头部
    static constexpr const char* TEXT_SPECTRUM_CODE = "spectrumCode";     //图谱类型编码
    static constexpr const char* TEXT_SPECTRUM_DATA_LENGTH = "spectrumDataLength";     //图谱数据长度
    static constexpr const char* TEXT_SPECTRUM_CREATE_TIME = "spectrumCreateTime";     //图谱生成时间
    static constexpr const char* TEXT_SPECTRUM_PROPERTY = "spectrumProperty";     //图谱性质
    static constexpr const char* TEXT_EQUIPMENT_NAME = "equipmentName";     //电力设备名称
    static constexpr const char* TEXT_EQUIPMENT_CODE = "equipmentCode";     //电力设备编码
    static constexpr const char* TEXT_TEST_POINT_NAME = "testPointName";     //测点名称
    static constexpr const char* TEXT_TEST_POINT_CODE = "testPointCode";     //测点编码
    static constexpr const char* TEXT_CHANNEL_INDEX = "channelIndex";     //检测通道标识
    static constexpr const char* TEXT_TEST_LOCATION = "testPointLocation";     //测点的测试部位
    static constexpr const char* TEXT_DATA_PRIMITIVE_TYPE = "storageDataType";     //存储数据类型编码

    static constexpr const char* TEXT_AMP_UNIT = "ampUnit";     //幅值单位
    static constexpr const char* TEXT_AMP_MIN = "ampMin";     //幅值范围下限
    static constexpr const char* TEXT_AMP_MAX = "ampMax";     //幅值范围上限
    static constexpr const char* TEXT_RMS_MIN = "RMSMin";     //有效值范围下限
    static constexpr const char* TEXT_RMS_MAX = "RMSMax";     //有效值范围上限
    static constexpr const char* TEXT_FREQ1_MIN = "freq1Min";     //频率成分一范围下限
    static constexpr const char* TEXT_FREQ1_MAX = "freq1Max";     //频率成分一范围上限
    static constexpr const char* TEXT_FREQ2_MIN = "freq2Min";     //频率成分二范围下限
    static constexpr const char* TEXT_FREQ2_MAX = "freq2Max";     //频率成分二范围上限
    static constexpr const char* TEXT_SENSOR_TYPE = "sensorType";     //超声传感器类型
    static constexpr const char* TEXT_PULSE_INTERVAL_UNIT = "pulseIntervalUnit"; //脉冲间隔时间单位
    static constexpr const char* TEXT_DATA_POINT = "dataPoint";     //数据点个数
    static constexpr const char* TEXT_SYSTEM_FREQUENCY = "systemFrequency";     //系统频率
    static constexpr const char* TEXT_PD_TYPE_PR = "PDTypePR";     //放电类型概率
    static constexpr const char* TEXT_BAND_WIDTH = "bandwidth";                    //频带
    static constexpr const char* TEXT_FRQ_MIN = "frequencyMin";                    //下限频率
    static constexpr const char* TEXT_FRQ_MAX = "frequencyMax";                    //上限频率
    static constexpr const char* TEXT_BG_FILE_NAME = "BGFileName";                    //背景文件名称
    static constexpr const char* TEXT_TRIGGER_THRESHOLD = "triggerThreshold";     //触发幅值
    static constexpr const char* TEXT_GAIN_TYPE = "gainType";  //增益的种类
    static constexpr const char* TEXT_OPEN_TIME = "openTime";     //开门时间
    static constexpr const char* TEXT_SHUT_TIME = "shutTime";     //关门时间
    static constexpr const char* TEXT_MAX_TIME_INTERVAL = "maxTimeInterval";     //最大间隔时间
    static constexpr const char* TEXT_GAIN = "gain";     //增益
    static constexpr const char* TEXT_SYNC_SOURCE = "syncSource";     //同步源
    static constexpr const char* TEXT_SYNC_STATE = "syncState";     //同步状态
    static constexpr const char* TEXT_SYNC_FREQ = "syncFreq";     //同步频率
    static constexpr const char* TEXT_DISCHARGE_SEVERITY = "dischargeSeverity";     //放电严重程度
    static constexpr const char* TEXT_DENOISING_THRESHOLD = "denoisingThreshold"; // 去噪阈值
    static constexpr const char* TEXT_PEAK = "peak";     //信号的最大值
    static constexpr const char* TEXT_RMS = "RMS";     //信号的均方根值
    static constexpr const char* TEXT_FREQUENCY1 = "frequency1";     //超声信号中被测系统频率分量的幅值
    static constexpr const char* TEXT_FREQUENCY2 = "frequency2";     //超声信号中两倍被测系统频率分量的幅值
    static constexpr const char* TEXT_PEAK_BG = "peakBG";     //背景信号的最大值
    static constexpr const char* TEXT_RMS_BG = "RMSBG";     //背景信号的均方根值
    static constexpr const char* TEXT_FREQUENCY1_BG = "frequency1BG";     //背景信号的均方根值
    static constexpr const char* TEXT_FREQUENCY2_BG = "frequency2BG";     //背景频率分量2相关性

    static constexpr const char* TEXT_WARNING_VALUE = "warningValue";     //预警值
    static constexpr const char* TEXT_ALARM_VALUE = "alarmValue";     //报警值
    static constexpr const char* TEXT_TEV_AMP = "TEVAmp";     //暂态地电压幅值数据
    static constexpr const char* TEXT_TEV_MAX = "TEVMax";     //暂态地电压幅值数据
    static constexpr const char* TEXT_PULSE_COUNT = "pulseCount";     //脉冲数
    static constexpr const char* TEXT_SEVERITY = "severity";     //严重程度

    static constexpr const char* TEXT_PHASE_INTVL_COUNT = "phaseIntervalCount";     //相位窗数
    static constexpr const char* TEXT_QUANTY_AMP = "quantificationAmp";     //量化幅值
    static constexpr const char* TEXT_PFRECYCLE_COUNT = "powerFreCycleCount";     //工频周期数
    static constexpr const char* TEXT_EFFECIVE_SIGN = "effectiveDataSign";     //数据有效判断

    // 机械特性xml节点名
    static constexpr const char* TEXT_DATA_COUNT = "dataCount";    //数据点数
    static constexpr const char* TEXT_SAMPLE_RATE = "sampleRate";    //采样率
    static constexpr const char* TEXT_CONVERT_FACTOR = "conversionFactor";  //转换系数
    static constexpr const char* TEXT_OPR_TYPE = "operationType";    //分合闸操作类型
    static constexpr const char* TEXT_CYCLE_COUNT = "powerFreCycleCount";    //工频周期数
    static constexpr const char* TEXT_MECH_DATA_TYPE = "mechDataType";     //数据类型
    static constexpr const char* TEXT_MECH_FUNCTION_TYPE = "operatingMechanismType";     //操作类型
    static constexpr const char* TEXT_MECH_STORAGE_TYPE = "mechStoredEnergyType";     //储能类型
    static constexpr const char* TEXT_COIL_UP_TIME = "coilUpTime";     //线圈带电时刻
    static constexpr const char* TEXT_HIT_TIME = "hitTime";     //铁芯撞击挚子时刻
    static constexpr const char* TEXT_AUX_SUB_SWITCH_CLOSE_TIME = "auxSubSwitchCloseTime";     //辅助开关切断时刻
    static constexpr const char* TEXT_COIL_DOWN_TIME = "coilDownTime";     //线圈断电时刻
    static constexpr const char* TEXT_COIL_MAX_CURRENT = "coilMaxCurrent";     //线圈最大电流
    static constexpr const char* TEXT_CONVERSION_FACTOR = "conversionFactor";     //转换系数
    static constexpr const char* TEXT_SWITCH_OPEN_TIME = "switchOpenTime";     //开关分时间
    static constexpr const char* TEXT_SWITCH_CLOSE_TIME = "switchCloseTime";     //开关合时间
    static constexpr const char* TEXT_SWITCH_TWICE_TIME = "switchTwiceTime";     //开关二分时间
    static constexpr const char* TEXT_SWITCH_OPEN_SYNC = "switchOpenSync";     //开关分同期性
    static constexpr const char* TEXT_SWITCH_CLOSE_SYNC = "switchCloseSync";     //开关合同期性
    static constexpr const char* TEXT_SWITCH_TWICE_SYNC = "switchTwiceSync";     //开关二分同期性
    static constexpr const char* TEXT_SWITCH_SHOT_TIME = "switchShotTime";     //金短时间
    static constexpr const char* TEXT_SWITCH_NO_CURRENT_TIME = "switchNoCurrentTime";     //无电流时间
    static constexpr const char* TEXT_MOTOR_START_CURRENT = "motorStartCurrent";     //电机启动电流
    static constexpr const char* TEXT_MOTOR_MAX_CURRENT = "motorMaxCurrent";     //电机最大电流
    static constexpr const char* TEXT_MOTOR_STORAGE_TIME = "motorStorageTime";     //电机储能时刻

    // 红外
    static constexpr const char* TEXT_TEMPERATURE_UNIT = "temperatureUnit";     // 温度单位
    static constexpr const char* TEXT_TEMPERATURE_LATTICE_WIDTH = "temperatureLatticeWidth";     // 温度点阵宽度w
    static constexpr const char* TEXT_TEMPERATURE_LATTICE_HEIGHT = "temperatureLatticeHeight";     // 温度点阵高度h
    static constexpr const char* TEXT_VISIBLE_LIGHT_PHOTO_DATA_LENGTH_L1 = "visibleLightPhotoDataLengthL1";     // 可见光照片数据长度L1
    static constexpr const char* TEXT_INFRARED_PHOTO_DATA_LENGTH_L2 = "infraredPhotoDataLengthL2";     // 红外照片数据长度L2
    static constexpr const char* TEXT_EMISSIVITY = "emissivity";     // 辐射率
    static constexpr const char* TEXT_MEASURE_DISTANCE = "measureDistance";     // 测试距离
    static constexpr const char* TEXT_ATMOSPHERIC_TEMPERATURE = "atmosphericTemperature";     // 大气温度
    static constexpr const char* TEXT_RELATIVE_HUMIDITY = "relativeHumidity";     // 相对湿度
    static constexpr const char* TEXT_REFLECTED_TEMPERATURE = "reflectedTemperature";     // 反射温度
    static constexpr const char* TEXT_TEMPERATURE_WIDTH_UPPER = "temperatureWidthUpper";     // 温宽上限
    static constexpr const char* TEXT_TEMPERATURE_WIDTH_LOWER = "temperatureWidthLower";     // 温宽上限
    static constexpr const char* TEXT_INFRARED_TEMPERATURE_DATA = "infraredTemperatureData";     // 红外温度数据
    static constexpr const char* TEXT_VISIBLE_LIGHT_PHOTO_DATA = "visibleLightPhotoData";     // 可见光照片数据
    static constexpr const char* TEXT_INFRARED_PHOTO_DATA = "infraredPhotoData";     // 红外照片数据

    // 电流幅值
    static constexpr const char* TEXT_CURRENT_DATA_COUNT = "currentDataCount"; // 电流数据个数
}
